package com.archermind.boc.xml;

import java.io.IOException;
import java.util.Properties;
import java.util.Map.Entry;

import com.archermind.boc.Logger;

public class Protocol {
	private final static Logger logger = Logger.getLogger(Protocol.class.getName());
	// 客户端准备提交数据
	public final static String client1 = "<stream:stream to=\"example.com\" version=\"1.0\">";
	// 客户端发起认证请求
	public final static String client2 = "<auth mechanism=\"PLAIN\"><value>AHRlc3QAMTIzNDU2</value></auth>";
	// 客户端发起授权申请
	public final static String client3 = "<iq to=\"example.com\" type=\"set\" id=\"sess_1\"><session/></iq>";
	public final static String client31 = "<iq to=\"example.com\" type=\"set\" id=\"sess_1\"><session><x><key1>value1</key1><key2>value</key2></x></session></iq>";
	public final static String client32 = "<iq id=\"reg1\"><register><x><loginName>juliet</loginName><password>R0m30</password><realName>fuck u</realName><netNum>******</netNum><role>suck</role></x><success>success</success><error>error</error></register></iq>";
	public final static String client33 = "<iq id=\"reg1\"><register><type>xxx</type><x><loginName>juliet</loginName><password>R0m30</password><realName>fuck u</realName><netNum>******</netNum><role>suck</role></x><success>success</success><error>error</error></register></iq>";
	public final static String client34 = "<iq id='1'><register><type>zw</type><x><ip></ip><loginName>yj</loginName><password>EQQAAPAPAABtbQAAFohFNsQPAADQDwAAcn+tM2Tmwj4sAQEAxA8AAMQPAACrEAAAsA8AAAAAD7AAAAGRAAAPsAG+AQEBBQYGDw8FBQ8PAAMELQCAAIABAIAAgAEAgACAAAAAAAEBAQIBEgAAAAEBEgEC8gES/wAAAAAAAAAAAAAAAAEAMADdAZEgIgCw/t0BBAAAAIAEAAEUAAAgIAFVAAkBAAAAAAAAAAAAl4x8cJaFg42Ih5yUk192AAD0AAAAAAAAAAAAAJqDhnuFf36EkIeLiYGAhYuRi5yLlZ+BiIIAAAAAAACFkIp/d3p1cZiUmI6Pj46HhouMkoudl4SGiYwAAAAAmZaZh4aIgXp+kpaSjYeNmZCMjo6MkJePjISMn4wAAACemJmakouJiY2ajoyRkYuGkIyOjpydk5WMjImUjQAAAJCUl56in56in5uVjZac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bFxb+oq63O0M3JxMXFwrm9vL3K0cm6AAAAAAAA1NfUzsrExrq60dnYy8jJxL7HwMLEw8zWwL4AAAAAAAAAxd3cz7fAucPM2t3dzcfHtsXRybXO5uXOAAAAAAAAAAAA6+Hg4uO3x8nM9+/YzsEA3NEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAh4AFAEyAAMABPYSGQ3YCBqqGj5HULzuqghNRLzXgPLwFu8ZWeCppOCE2uov6dXOzLjvQ57yoLsZzM/Piam58RZE56pDlc5+zX7xDg4CGQjRuo5QoansRahKQk3yz9dOualnu9Z+j47W1YChRyp77EVE6UW5GrnwuKm4oICASuYXF8xFRUJETdGGfpu2F+7yGQbvj9GNiUpFuUwOucTMRU6PoI7az8/M50TnRZhMTRdoqbi4Z4nfqd+Em4g+TczMzJmOjokZF4CJqRZCGESEAgAAAQAKAAP/7gQCAgEzA64DDQLYAQEABv/8AAwEAgIB3wOuAyYC5gIB//z//gAeBAICAQsDDQMmAiMSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</password><realName>yj</realName><netNum>1</netNum><role>经办</role></x></register></iq>";
	// 客户端发送图片,基本信息等
	public final static String client4 = "<message id=\"gki7q-30\" to=\"example.com\"><x><key1>value1</key1><key2>value2</key2></x></message>";
	public final static String client41 = "<message id=\"gki7q-30\" to=\"example.com\"><x><image>image1</image><image>image2</image></x></message>";
	// 客户端发送聊天信息
	public final static String client5 = "<message id=\"gki7q-31\" to=\"example.com\" from=\"test@arch/spark\" type=\"chat\"><body>china go go </body></message>";

	// 客户端签入签出
	public final static String client6 = "<presence><show>0</show></presence>";
	// 客户端发语音聊天请求

	public final static String client7 = "<iq from=\"client1\" id=\"zid615d9\" to=\"client2\" type=\"set\"><jingle action=\"session-initiate\" initiator=\"client1\" sid=\"a73sjjvkla37jfea\"><content creator=\"initiator\" name=\"this-is-a-stub\"><transport ip=\"000000\" port=\"80\" xmlns=\"urn:xmpp:jingle:transports:stub:0\">transport</transport></content></jingle></iq>";
	public final static String client71 = "<iq id=\"1\" from=\"jxh\" to=\"192.168.12.18\" type=\"talk\"><jingle action=\"session-initiate\" initiator=\"jxh\" sid=\"jxh\"><content creator=\"jxh\" name=\"姜\"><transport ip=\"192.168.12.45\" port=\"4545\"></transport></content></jingle></iq>";
	// 客户端发起视频请求
	public final static String client8 = "<iq from=\"client1\" id=\"zid615d9\" to=\"client2\" type=\"set\"><video action=\"session-initiate\" initiator=\"client1\" sid=\"a73sjjvkla37jfea\"><content creator=\"initiator\" name=\"this-is-a-stub\"><transport xmlns=\"urn:xmpp:jingle:transports:stub:0\"/></content></video></iq>";

	// 客户端请求授权结束
	public final static String client9 = "</stream:stream>";

	// 服务器准备接收数据
	public final static String server1_0 = "<stream:stream from=\"example.com\" id=\"b6ebbd81\" version=\"1.0\">";
	// 支持数据的加密类型
	public static String server1_1;
	static {

		try {
			Properties props = new Properties();
			props.load(Protocol.class.getClassLoader().getResourceAsStream("com/archermind/boc/xml/supportMechanisims.properties"));
			String mechanisim = "";
			for (Entry<Object, Object> en : props.entrySet()) {
				mechanisim += "<mechanism>" + en.getValue() + "</mechanism>";
			}
			server1_1 = "<stream:features><mechanisms>" + mechanisim + "</mechanisms><auth/></stream:features>";
		} catch (IOException e) {
			logger.error("error when load supportMechanisims.properties", e);
		}
		// server1_1 =
		// "<stream:features><mechanisms><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><auth/></stream:features>";
	}
	// 响应认证请求
	public final static String server2 = "<success role=\"0\" counter=\"10000\" netnumber=\"2000002\" name=\"张三\"></success><error></error>";
	// 响应授权申请
	public final static String server3 = "<iq from=\"example.com\" type=\"result\" id=\"sess_1\"></iq>";
	// 客户端发送基本信息是需发送
	public final static String server4 = "<message id=\"gki7q-30\" to=\"client\" from=\"server\"><x><cd>CountDown</cd></x></message>";
	// 响应聊天信息
	public final static String server5 = "<message id=\"4Erlr-28\" to=\"example.com\" from=\"test01@arch/spark\" type=\"chat\"><body>welljust gog go </body></message>";
}
